"""
 Copyright 2009 White Waters Software
 White Waters Software Copyright 2007 Jason White

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.

 CONTACT: whitewaterssoftwareinfo@gmail.com
 
 Medina , Ohio , United States Of America , Solar System , Milky Way Galaxy , The Universe : as I know it
 """
import pygame
import os
e=""


def load_image(name, colorkey=None):
    fullname = os.path.join('data', name)
    try:
        image = pygame.image.load(fullname)
    except pygame.error, message:
        print 'Cannot load image:', name
        raise SystemExit, message
    image = image.convert()
    if colorkey is not None:
        if colorkey is -1:
            colorkey = image.get_at((0,0))
        image.set_colorkey(colorkey)#, RLEACCEL
    return image , image.get_rect()

def init():
    pygame.init()
    pygame.display.init()

    screen=pygame.display.set_mode((800,600))#,pygame.FULLSCREEN)

    background = pygame.Surface(screen.get_size())
    background = background.convert()
    background.fill((50, 0, 30))

    pygame.mouse.set_visible(0)
    #objects
    objects.index=[]
    ind=objects.player()
    objects.index.append(ind)
    ind.ind=ind
    
def exit_game():
    #pygame.mixer.music.stop()
    pygame.quit()
    raise SystemExit 


